package m3d31;

import java.io.FileWriter;
import java.io.IOException;

//Writer是字符输出流的顶层父类，抽象类
public class cWriter {
    public static void main(String[] args) throws IOException {
        FileWriter fw = new FileWriter("day02\\src\\m3d31\\b.txt",true);

        //把数据写入内存缓冲区，字符转换成字节
        fw.write(97);

        char[] chars1 = {'欸','2','3'};
        fw.write(chars1);
        fw.write(chars1,0,2); //xie两个
        fw.write("发生了");
        fw.write("发生了",1,2);

        //缓冲区刷新到文件
        fw.flush();

        //释放资源前会刷新缓冲区到文件
        fw.close();
    }
}
